<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                template="./template/TCubeTemplate.xhtml">
    <ui:define name="contentInsert">
        <h:body>
            <h:form id="formMain">
                <h1>TCube View All stakeholders</h1>

                <p:panel header="View All Stakeholders">

                    <p:dataTable var="stakeholder" value="#{tCubeManagerBean.stakeholders}" paginator="true" 
                                 rows="10" emptyMessage="No stakeholder" selection="#{tCubeManagerBean.selectedStakeholder}" 
                                 selectionMode="single" rowSelectListener="#{tCubeManagerBean.onRowSelectNavigate}"
                                 dblClickSelect="true">

                        <p:column sortBy="#{stakeholder.id}" filterBy="#{stakeholder.id}">
                            <f:facet name="header">
                                <h:outputText value="ID" />
                            </f:facet>
                            <h:outputText value="#{stakeholder.id}" />
                        </p:column>
                        <p:column sortBy="#{stakeholder.username}" filterBy="#{stakeholder.username}">
                            <f:facet name="header">
                                <h:outputText value="Username" />
                            </f:facet>
                            <h:outputText value="#{stakeholder.username}" />
                        </p:column>
                        <p:column sortBy="#{stakeholder.corpName}" filterBy="#{stakeholder.corpName}">
                            <f:facet name="header">
                                <h:outputText value="Corporate name" />
                            </f:facet>
                            <h:outputText value="#{stakeholder.corpName}" />
                        </p:column>
                    </p:dataTable>

                    <p:dialog header="ABC" widgetVar="dialog" resizable="false" width="200" 
                              showEffect="explode" hideEffect="explode">
                        <h:panelGrid id="display" columns="2" cellpadding="4">
                            <h:outputText value="name" />
                            <h:outputText value="#{tCubeManagerBean.selectedStakeholder.username}" />
                        </h:panelGrid>

                    </p:dialog>    
                </p:panel>
            </h:form>
        </h:body>
    </ui:define>
</ui:composition>